<!DOCTYPE html>
<html>
<head>
	<!-- 公共页面 -->
	#include("../include/common.html")
	<!-- 公共页面 /-->
</head>
<body class="hold-transition skin-purple sidebar-mini">
    <div class="wrapper">
        <!-- 页面头部 -->
        #include("../include/header.html")
        <!-- 页面头部 /-->
        <!-- 导航侧栏 -->
        #include("../include/menu.html")
        <!-- 导航侧栏 /-->
        <!-- 内容区域 -->
        <div class="content-wrapper" id="contentDiv">
            <!-- 正文区域 -->
            <section class="content">
            	<form id="inputForm" action="update" method="post">
            	<input type="hidden" name="id" value="#(admin.id)">
				<!--表单信息-->
                <div class="panel panel-default" style="padding-bottom: 10px;">
                    <div class="panel-heading">用户信息</div>
                    <div class="row data-type">
                        <div class="col-md-2 title">姓名</div>
                        <div class="col-md-10 data">
                            <input type="text" class="form-control" placeholder="姓名" name="name" value="#(admin.name)">
                        </div>
                        <div class="col-md-2 title">角色</div>
                        <div class="col-md-10 data">
                            <div class="form-group form-inline">
                            	#for(role : roles)
                                <div class="radio"><label><input type="radio" name="roleIds" value="#(role.id)" #if(admin.roleIds.contains(role.id)) checked #end> #(role.name)</label></div>
                                #end
                            </div>
                        </div>
                    </div>
	                <!--工具栏-->
	                <div class="box-tools text-center">
	                    <button type="submit" class="btn bg-maroon">保存</button>
	                    <button type="button" class="btn bg-default" onclick="history.back(-1);">返回</button>
	                </div>
	                <!--工具栏/-->
                </div>
                <!--表单信息/-->
                </form>
            </section>
            <!-- 正文区域 /-->
        </div>
        <!-- 内容区域 /-->
        <!-- 底部导航 -->
        #include("../include/footer.html")
        <!-- 底部导航 /-->
    </div>
</body>
</html>
<!---->
<script>
 $(document).ready(function() {
     // 激活导航位置
     setSidebarActive("admin-admin");
 });
</script>
<script type="text/javascript">
$().ready(function() {

	var $inputForm = $("#inputForm");
	
	// 表单验证
	$inputForm.validate({
		rules: {
			name: "required",
			roleIds:"required"
		}
	});

});
</script>